﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using System.ComponentModel;
using System.Windows;
using System.Xml.Serialization;

namespace BDSim
{
    

    /// <summary>
    /// 卫星轨道位置速度类，用于窗口属性参数设置
    /// </summary>
    [TypeConverter(typeof(ExpandableObjectConverter))]
    public class NodePosVelClass
    {
        /// <summary>
        /// 轨道历元
        /// </summary>
        [XmlIgnore]
        private UTCTimeClass epoch = new UTCTimeClass();

        [DescriptionAttribute("初始轨道历元"), TypeConverter(typeof(PropertySorter)), PropertyOrder(1),Browsable(false)]
        public UTCTimeClass Epoch
        {
            get { return epoch; }
            set { epoch = value; }
        }

        [XmlIgnore]
        public double x;

        [XmlIgnore]
        public double y;

        [XmlIgnore]
        public double z;

        [XmlIgnore]
        public double vx;

        [XmlIgnore]
        public double vy;

        [XmlIgnore]
        public double vz;

        [XmlAttribute, DescriptionAttribute("卫星X方向初始位置，单位(米)"),PropertyOrder(2)]
        public double X { get { return x; } set { x = value; } }

        [XmlAttribute, DescriptionAttribute("卫星Y方向初始位置，单位(米)"), PropertyOrder(3)]
        public double Y { get { return y; } set { y = value; } }

        [XmlAttribute, DescriptionAttribute("卫星Z方向初始位置，单位(米)"), PropertyOrder(4)]
        public double Z { get { return z; } set { z = value; } }

        [XmlAttribute, DescriptionAttribute("卫星X方向初始速度，单位(米/秒)"), PropertyOrder(5)]
        public double VX { get { return vx; } set { vx = value; } }

        [XmlAttribute, DescriptionAttribute("卫星Y方向初始速度，单位(米/秒)"), PropertyOrder(6)]
        public double VY { get { return vy; } set { vy = value; } }

        [XmlAttribute, DescriptionAttribute("卫星Z方向初始速度，单位(米/秒)"), PropertyOrder(7)]
        public double VZ { get { return vz; } set { vz = value; } }

        public override string ToString()
        {
            return string.Empty;
        }

        public NodePosVel ConvertToStruct()
        {
            NodePosVel PosVel = new NodePosVel();
            PosVel.Epoch = Epoch.ToUTCTime();
            PosVel.X = x;
            PosVel.Y = y;
            PosVel.Z = z;
            PosVel.VX = vx;
            PosVel.VY = vy;
            PosVel.VZ = vz;
            return PosVel;
        }
    }

    /// <summary>
    /// 卫星轨道6根数
    /// </summary>
    public struct Orbit6Element
    {
        public UTCTime epoch;			//轨道历元 
        public double a;			// 轨道椭圆的长半轴
        public double e;			// 轨道椭圆的偏心率
        /// <summary>
        /// 升交点赤经，单位：度
        /// </summary>
        public double O;			// 升交点的赤经
        public double i;			// 轨道面的倾角
        public double w;			// 近地点角距

        public double f;			// 卫星的真近点角

        /// <summary>
        /// 结构体转为类
        /// </summary>
        /// <returns></returns>
        public OrbitSixElementClass ConvertToClass()
        {
            OrbitSixElementClass Ele = new OrbitSixElementClass();
            Ele.epoch = epoch.ToUTCTimeClass();
            Ele.a = a;
            Ele.e = e;
            Ele.f = f;
            Ele.i = i;
            Ele.O = O;
            Ele.w = w;
            return Ele;
        }
        //public Orbit6Element()
        //{
        //    epoch = new UTCTime();
        //    a = e = O = i = w = f = 0;
        //}
    }

    /// <summary>
    /// 卫星轨道12根数结构体
    /// </summary>
    [StructLayout(LayoutKind.Sequential)]
    public struct Orbit12Element
    {
        /// <summary>
        /// UTC形式的轨道历元
        /// </summary>
        public UTCTime epoch;

        /// <summary>
        /// 轨道椭圆的长半轴
        /// </summary>
        public double a;

        /// <summary>
        /// 轨道椭圆的偏心率
        /// </summary>
        public double e;

        /// <summary>
        /// 升交点的赤经
        /// </summary>
        public double O;

        /// <summary>
        /// 轨道面的倾角
        /// </summary>
        public double i;

        /// <summary>
        /// 近地点角距 
        /// </summary>
        public double w;

        /// <summary>
        /// 卫星的偏近点角
        /// </summary>
        public double E;

        /// <summary>
        /// 卫星的平近点角
        /// </summary>
        public double M;

        /// <summary>
        /// 卫星的真近点角 
        /// </summary>
        public double f;

        /// <summary>
        /// 卫星的升交距角
        /// </summary>
        public double u;

        /// <summary>
        /// 平均轨道角速度
        /// </summary>
        public double n;

        /// <summary>
        /// 卫星经过近地点时间
        /// </summary>
        public double t0;

        /// <summary>
        /// 卫星的初始平近点角
        /// </summary>
        public double M0;
    };

    ///// <summary>
    ///// 卫星轨道根数结构体,与界面交互
    ///// </summary>
    //[TypeConverter(typeof(ExpandableObjectConverter))]
    //public class OrbitSixElementClass
    //{
    //    /// <summary>
    //    /// UTC形式的轨道历元
    //    /// </summary>
    //    public UTCTime t;

    //    /// <summary>
    //    /// 轨道椭圆的长半轴 
    //    /// </summary>
    //    [CategoryAttribute("轨道六根数"), DescriptionAttribute("轨道椭圆的长半轴 ，单位为米（M）"), TypeConverter(typeof(ExpandableObjectConverter))]
    //    public double a { get; set; }

    //    /// <summary>
    //    /// 轨道椭圆的偏心率
    //    /// </summary>
    //    [CategoryAttribute("轨道六根数"), DescriptionAttribute("轨道椭圆的偏心率 "), TypeConverter(typeof(ExpandableObjectConverter))]
    //    public double e { get; set; }

    //    /// <summary>
    //    /// 升交点的赤经
    //    /// </summary>
    //    [CategoryAttribute("轨道六根数"), DescriptionAttribute("升交点的赤经，单位为度 "), TypeConverter(typeof(ExpandableObjectConverter))]
    //    public double O { get; set; }

    //    /// <summary>
    //    /// 轨道面的倾角
    //    /// </summary>
    //    [CategoryAttribute("轨道六根数"), DescriptionAttribute("轨道面的倾角，单位为度 "), TypeConverter(typeof(ExpandableObjectConverter))]
    //    public double i { get; set; }

    //    /// <summary>
    //    /// 近地点角距
    //    /// </summary>
    //    [CategoryAttribute("轨道六根数"), DescriptionAttribute("近地点角距，单位为度 "), TypeConverter(typeof(ExpandableObjectConverter))]
    //    public double w { get; set; }

    //    /// <summary>
    //    /// 卫星的偏近点角
    //    /// </summary>
    //    public double E;

    //    /// <summary>
    //    /// 卫星的平近点角
    //    /// </summary>
    //    public double M;

    //    /// <summary>
    //    /// 卫星的真近点角
    //    /// </summary>
    //    [CategoryAttribute("轨道六根数"), DescriptionAttribute("真近点角，单位为度 "), TypeConverter(typeof(ExpandableObjectConverter))]
    //    public double f { get; set; }

    //    /// <summary>
    //    /// 卫星的升交距角
    //    /// </summary>
    //    public double u;

    //    /// <summary>
    //    /// 平均轨道角速度
    //    /// </summary>
    //    public double n;

    //    /// <summary>
    //    /// 卫星经过近地点时间
    //    /// </summary>
    //    public double t0;

    //    /// <summary>
    //    /// 卫星的初始平近点角
    //    /// </summary>
    //    public double M0;

    //    public override string ToString()
    //    {
    //        return "SatOrbitSixElement";
    //    }
    //}     

    /// <summary>
    /// 卫星轨道根数结构体,与界面交互
    /// </summary>
    [TypeConverter(typeof(ExpandableObjectConverter))]
    public class OrbitSixElementClass
    {
        private UTCTimeClass _epoch;

        /// <summary>
        /// UTC形式的轨道历元
        /// </summary>
       [Browsable(false)]
        public UTCTimeClass epoch
        {
            get { return _epoch; }
            set { _epoch = value; }
        }

        private double _a;

        /// <summary>
        /// 轨道椭圆的长半轴 
        /// </summary>
        [CategoryAttribute("轨道六根数"), DescriptionAttribute("轨道椭圆的长半轴 ，单位为米（M）")]
        public double a
        {
            get { return _a; }
            set { _a = value; }
        }

        private double _e;

        /// <summary>
        /// 轨道椭圆的偏心率
        /// </summary>
        [CategoryAttribute("轨道六根数"), DescriptionAttribute("轨道椭圆的偏心率 ")]
        public double e
        {
            get { return _e; }
            set { _e = value; }
        }


        private double _O;

        /// <summary>
        /// 升交点的赤经
        /// </summary>
        [CategoryAttribute("轨道六根数"), DescriptionAttribute("升交点的赤经，单位为度 ")]
        public double O
        {
            get { return _O; }
            set { _O = value; }
        }

        private double _i;

        /// <summary>
        /// 轨道面的倾角
        /// </summary>
        [CategoryAttribute("轨道六根数"), DescriptionAttribute("轨道面的倾角，单位为度 ")]
        public double i
        {
            get { return _i; }
            set { _i = value; }
        }



        private double _w;

        /// <summary>
        /// 近地点角距
        /// </summary>
        [CategoryAttribute("轨道六根数"), DescriptionAttribute("近地点纬度幅角，单位为度 ")]
        public double w
        {
            get { return _w; }
            set { _w = value; }
        }

        private double _f;

        /// <summary>
        /// 卫星的真近点角
        /// </summary>
        [CategoryAttribute("轨道六根数"), DescriptionAttribute("真近点角，单位为度 ")]
        public double f
        {
            get { return _f; }
            set { _f = value; }
        }               

        public override string ToString()
        {
            return string.Empty;
        }

        public Orbit6Element ConvertToStruct()
        {
            Orbit6Element Ele = new Orbit6Element();
            Ele.epoch = epoch.ToUTCTime();
            Ele.a = a;
            Ele.e = e;
            Ele.f = f;
            Ele.i = i;
            Ele.O = O;
            Ele.w = w;
            return Ele;
        }
    }     

    /// <summary>
    /// 卫星位置的坐标类型
    /// </summary>
    public enum SatPosType
    {
        CGCS2000,
        J2000,
        六根数
    }

    /// <summary>
    /// 星座类型
    /// </summary>
    public enum EConstellationType
    {
        /// <summary>
        /// 北斗星座
        /// </summary>
        BD,
        /// <summary>
        /// GPS星座
        /// </summary>
        GPS,
        /// <summary>
        /// 格洛纳斯星座
        /// </summary>
        GLONASS,
        /// <summary>
        /// 伽利略星座
        /// </summary>
        GALILEO,
    }

    /// <summary>
    /// 卫星类型
    /// </summary>
    public enum EOrbitType
    {
        GEO,
        MEO,
        IGSO,
    }
  
    /// <summary>
    /// 轨道动力学配置参数类，用于界面设置
    /// </summary>
    [TypeConverter(typeof(ExpandableObjectConverter))]
    public class OrbitPredictParamClass
    {
        #region 字段        

        /// <summary>
        /// 
        /// </summary>
        private EPropagateType _PropagateType = EPropagateType.HPOP;

        /// <summary>
        /// 卫星等效横截面积；界面输入
        /// </summary>
        private double _SatArea=2;

        /// <summary>
        /// 卫星质量；界面输入
        /// </summary>
        private double _SatMass=1000;

        /// <summary>
        /// 非球形摄动；界面输入
        /// </summary>
        private bool _NonSphPert = true;

        /// <summary>
        /// 引力场模型
        /// </summary>
        private EEarthPotentialModel _EarthPotentialModel;

        /// <summary>
        /// 引力场模型最高阶数；界面输入
        /// </summary>
        private int _EarthPotentialM=10;

        /// <summary>
        /// 引力场模型最高次数；界面输入
        /// </summary>
        private int _EarthPotentialN = 10;

        /// <summary>
        /// 太阳引力摄动控制参数；界面输入
        /// </summary>
        private bool _SunPert = true;

        /// <summary>
        /// 月球引力摄动控制参数；界面输入
        /// </summary>
        private bool _MoonPert = true;
        
        /// <summary>
        /// 太阳光压摄动控制参数；界面输入
        /// </summary>
        private bool _SunSrpPert = true;

        /// <summary>
        /// 太阳光压模型选择0:3参数球模型；1:6参数模型；2:9参数模型；
        /// </summary>
        private int _SunSrpModel = 0;

        /// <summary>
        /// 阴影模型选取标志，0-不考虑，1-柱形模型，2-椎形模型；界面输入
        /// </summary>
        private int _ShadModelTag = 2;

        /// <summary>
        /// 太阳光压参数（9参）；界面输入
        /// </summary>
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 9)]
        private double[] _SunSrpParam = { 1.2, 0, 0, 0, 0, 0, 0, 0, 0 };
        
        /// <summary>
        /// ROCK模型选择，1: ROCK T MODEL (T10, T20, T30)，2: ROCK S MODEL (S10, S20) ，8: CODE MODEL (9801) ， 9: JPL MODEL (GPS_XYZ)
        /// </summary>
        private int _ROCKM;
        
        /// <summary>
        /// BLOCK模型，1: BLOCK I， 2: BLOCK II，3: BLOCK IIA，4: BLOCK IIR，5: BLOCK IIF
        /// </summary>
        private int _BLOCK;

        /// <summary>
        /// ROCK模型参数
        /// </summary>
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 9)]
        private double[] _P02RAD;

        /// <summary>
        /// 相对论效应控制参数；0：开关关闭，不考虑；其他值，开关打开，考虑相对论效应摄动
        /// </summary>
        private bool _Rel;
                
        /// <summary>
        /// 固体潮汐摄动控制开关，0：不考虑；其他值，开关打开，考虑固体潮汐摄动
        /// </summary>
        private bool _Tide;

        #endregion

        #region 属性

        public EPropagateType PropagateType
        {
            get { return _PropagateType; }
            set { _PropagateType = value; }
        }

        /// <summary>
        ///卫星等效横截面积,单位(㎡) 
        /// </summary>
        [DescriptionAttribute("卫星等效横截面积,单位(㎡)")]
        public double SatArea
        {
            get { return _SatArea; }
            set
            {
                if (value >= 0)
                {
                    _SatArea = value;
                }
            }
        }

        /// <summary>
        /// 卫星质量,单位(kg)
        /// </summary>
        [DescriptionAttribute("卫星质量,单位(kg)")]
        public double SatMass
        {
            get { return _SatMass; }
            set
            {
                if (value >= 0)
                {
                    _SatMass = value;
                }
            }
        }

        /// <summary>
        /// 非球形摄动
        /// </summary>
        [DescriptionAttribute("非球形摄动")]
        public bool NonSphPert
        {
            get { return _NonSphPert; }
            set { _NonSphPert = value; }
        }

        /// <summary>
        /// 引力场模型
        /// </summary>
        [DescriptionAttribute("地球引力场模型")]
        public EEarthPotentialModel EarthPotentialModel
        {
            get { return _EarthPotentialModel; }
            set { _EarthPotentialModel = value; }
        }

        /// <summary>
        /// 引力场模型最高阶数
        /// </summary>
        [DescriptionAttribute("田谐项最高阶数")]
        public int EarthPotentialM
        {
            get { return _EarthPotentialM; }
            set
            {
                if (value < 0 || value > 10)
                {
                    MessageBox.Show("田谐项最高次数需设置在[0,10]之间!");
                }
                else if (value < _EarthPotentialN)
                {
                    MessageBox.Show("SphFiledM应大于等于SphFiledN");
                }
                else
                {
                    _EarthPotentialM = value;
                }
            }
        }

        /// <summary>
        /// 引力场模型最高次数
        /// </summary>
        [DescriptionAttribute("田谐项最高次数")]
        public int EarthPotentialN
        {
            get { return _EarthPotentialN; }
            set
            {
                if (value > _EarthPotentialM)
                {
                    MessageBox.Show("SphFiledN应小于等于SphFiledM");
                }
                else
                {
                    _EarthPotentialN = value;
                }
            }
        }

        /// <summary>
        /// 太阳引力摄动控制参数
        /// </summary>
        [DescriptionAttribute("太阳引力摄动控制参数")]
        public bool SunPert
        {
            get { return _SunPert; }
            set { _SunPert = value; }
        }

        /// <summary>
        /// 月球引力摄动控制参数
        /// </summary>
        [DescriptionAttribute("月球引力摄动控制参数")]
        public bool MoonPert
        {
            get { return _MoonPert; }
            set { _MoonPert = value; }
        }

        /// <summary>
        /// 太阳光压摄动控制参数
        /// </summary>
        [DescriptionAttribute("太阳光压摄动控制参数")]
        public bool SunSrpPert
        {
            get { return _SunSrpPert; }
            set { _SunSrpPert = value; }
        }

        /// <summary>
        ///太阳光压模型选择0:3参数球模型；1:6参数模型；2:9参数模型 
        /// </summary>
        [DescriptionAttribute("太阳光压模型选择0:3参数球模型；1:6参数模型；2:9参数模型")]
        public int SunSrpModel
        {
            get { return _SunSrpModel; }
            set
            {
                if (value >= 0 && value <= 2)
                {
                    _SunSrpModel = value;
                }
            }
        }

        /// <summary>
        /// 阴影模型选取标志，0-不考虑，1-柱形模型，2-椎形模型
        /// </summary>
        [DescriptionAttribute("阴影模型选取标志，0-不考虑，1-柱形模型，2-椎形模型")]
        public int ShadModelTag
        {
            get { return _ShadModelTag; }
            set
            {
                if (value >= 0 && value <= 2)
                {
                    _ShadModelTag = value;
                }
            }
        }

        /// <summary>
        /// 太阳光压参数（9参）
        /// </summary>
        [ DescriptionAttribute("太阳光压参数（9参）"), DisplayName("SunSrpParam")]
        public double[] SunRprParam
        {
            get { return _SunSrpParam; }
            set { _SunSrpParam = value; }
        }

        /// <summary>
        /// ROCK模型选择
        /// </summary>
        [DescriptionAttribute("ROCK模型选择，1: ROCK T MODEL (T10, T20, T30)，2: ROCK S MODEL (S10, S20) ，8: CODE MODEL (9801) ， 9: JPL MODEL (GPS_XYZ)")]
        public int ROCKM
        {
            get { return _ROCKM; }
            set { _ROCKM = value; }
        }

        /// <summary>
        /// BLOCK模型，1: BLOCK I， 2: BLOCK II，3: BLOCK IIA，4: BLOCK IIR，5: BLOCK IIF
        /// </summary>
        [DescriptionAttribute("BLOCK模型，1: BLOCK I， 2: BLOCK II，3: BLOCK IIA，4: BLOCK IIR，5: BLOCK IIF")]
        public int BLOCK
        {
            get { return _BLOCK; }
            set { _BLOCK = value; }
        }

        /// <summary>
        /// ROCK模型参数
        /// </summary>
        [DescriptionAttribute("ROCK模型参数")]
        public double[] P02RAD
        {
            get { return _P02RAD; }
            set { _P02RAD = value; }
        }

        [DescriptionAttribute("相对论效应控制参数；0：开关关闭，不考虑；其他值，开关打开，考虑相对论效应摄动")]
        public bool Rel
        {
            get { return _Rel; }
            set { _Rel = value; }
        }

        /// <summary>
        /// 固体潮汐摄动控制开关，0：不考虑；其他值，开关打开，考虑固体潮汐摄动
        /// </summary>
        [DescriptionAttribute(" 固体潮汐摄动控制开关，0：不考虑；其他值，开关打开，考虑固体潮汐摄动")]
        public bool Tide
        {
            get { return _Tide; }
            set { _Tide = value; }
        }      

        #endregion

        public OrbitPredict_Param ConvertToStruct()
        {
            OrbitPredict_Param newParam = new OrbitPredict_Param();

            //赋值的过程
            newParam.m_BLOCK = this._BLOCK;
            newParam.m_bMoonPert = Convert.ToInt16(MoonPert);
            newParam.m_bNonSphPert = Convert.ToInt16( NonSphPert);
            newParam.m_bSrpPert = Convert.ToInt16(SunSrpPert);
            newParam.m_bSunPert = Convert.ToInt16(SunPert);
            newParam.m_LeapSec = 36;
            newParam.m_nSHADModel = ShadModelTag;
            newParam.m_nSphFiledM = EarthPotentialM;
            newParam.m_nSphFiledN = EarthPotentialN;
            newParam.m_nSPRModel = SunSrpModel;
            newParam.m_orbit = new NodePosVel()
            {
                Epoch = new UTCTime() { year = 2015, mon = 10, day = 1, hour = 12, min = 0, sec = 0 },
                x = 16983361.4247804990,
                y = -20353706.4413478,
                z = -0.00155838616757,
                vx = 1709.450048999987,
                vy = 1426.384334400012,
                vz = 3179.607803900002
            };
            newParam.m_rel = Convert.ToInt16(Rel);
            newParam.m_tide = Convert.ToInt16(Tide);
            newParam.SRP = SunRprParam;
            newParam.m_Sat_Mass = SatMass;
            newParam.m_P02RAD = P02RAD;
            newParam.m_Sat_Area = SatArea;
            return newParam;
        }

        public override string ToString()
        {
            return string.Empty;
        }
    }

    /// <summary>
    /// 轨道后插表
    /// </summary>
    public struct BackDiff
    {
        /// <summary>
        /// 积分步长
        /// </summary>
        public double step;

        /// <summary>
        /// 积分结束时刻
        /// </summary>
        public double timeOfEnd;

        /// <summary>
        /// 卫星位置
        /// </summary>
        public double x, y, z;

        /// <summary>
        /// 卫星速度
        /// </summary>
        public double vx, vy, vz;

        /// <summary>
        /// 后差表
        /// </summary>
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 42)]
        public double[] diff;
    };

    public enum EPropagateType
    {
        TwoBody,
        HPOP
    }

    public enum EEarthPotentialModel
    {
        JGM3,
        TEG4,
        EIGEN2
    }

    /// <summary>
    /// 积分器类型
    /// </summary>
    public enum EIntegratorType
    {
        RKF7,
        KSG
    }

    /// <summary>
    /// 光压模型
    /// </summary>
    public enum ESrpModel
    {
        球模型,
        六参数模型,
        九参数Bernese模型
    }

    /// <summary>
    /// 阴影模型
    /// </summary>
    public enum EShadeModel
    {
        不考虑,
        柱形模型,
        锥形模型
    }
    
    /// <summary>
    /// 积分器设置
    /// </summary> 
    public class IntegrationParamClass
    {
        #region 字段

        /// <summary>
        /// 积分器类型
        /// </summary>
        private EIntegratorType _Integration;

        /// <summary>
        /// 积分步长
        /// </summary>
        private int _StepSize=60;

        #endregion

        #region 属性

        public EIntegratorType Integration
        {
            get { return _Integration; }
            set { _Integration = value; }
        }

        public int StepSize
        {
            get { return _StepSize; }
            set { _StepSize = value; }
        }

        #endregion

        public override string ToString()
        {
            return string.Empty;
        }
    }

    #region 卫星轨道动态库增加结构体

    [StructLayout(LayoutKind.Sequential)]
    public struct SimParam
    {
        /// <summary>
        /// 记录当前仿真步数计数，从0开始
        /// </summary>
        public int simClks;

        /// <summary>
        /// 仿真步长（4）单位为微秒
        /// </summary>
        public int simStepInt;
        public UTCTime pStartTime;
    };

    /// <summary>
    /// 轨道预报输入
    /// </summary>
    public struct OrbitPredict_Input
    {
        //输入时间，相对时间(单位：s)相对于积分器初始轨道点状态的历元时间
        public double startTime;
        //输出时间，相对时间(单位：s)相对于积分器初始轨道点状态的历元时间		
        public double endTime;
        //积分器步长；界面输入		
        public double step;
        //上一步积分结果
        public BackDiff presatdf;
    }

    /// <summary>
    /// 轨道预报参数
    /// </summary>
    public struct OrbitPredict_Param
    {
        //卫星编号；
        public int SatID;
        //卫星类型，0-未知,1-MEO,2-IGSO3-GEO；			
        public int m_Sat_nType;
        //卫星等效横截面积；
        public double m_Sat_Area;
        //卫星质量；
        public double m_Sat_Mass;

        //非球形摄动；
        public int m_bNonSphPert;
        //田谐项最高阶数；
        public int m_nSphFiledM;
        //田谐项最高次数；	
        public int m_nSphFiledN;

        //太阳引力摄动控制参数；	
        public int m_bSunPert;
        //月球引力摄动控制参数；
        public int m_bMoonPert;
        //太阳光压摄动控制参数；
        public int m_bSrpPert;

        //太阳光压模型选择0:3参数球模型；1:6参数模型；2:9参数模型；
        public int m_nSPRModel;
        //阴影模型选取标志，0-不考虑，1-柱形模型，2-椎形模型；界面输入
        public int m_nSHADModel;
        //太阳光压参数（9参）；一定要赋初值，如果是3参球模型，一般SRP[0]=1，SRP[1~8]={0}；如果是9参模型，可读模型文件获取系数（lhz）
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 9)]
        public double[] SRP;
        //ROCK模型选择，1: ROCK T MODEL (T10, T20, T30)，2: ROCK S MODEL (S10, S20) ，8: CODE MODEL (9801) ， 9: JPL MODEL (GPS_XYZ)
        public int m_ROCKM;
        //BLOCK模型，1: BLOCK I， 2: BLOCK II，3: BLOCK IIA，4: BLOCK IIR，5: BLOCK IIF
        public int m_BLOCK;
        //前两个模型的参数			
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
        public double[] m_P02RAD;
        //相对论效应控制参数；0：开关关闭，不考虑；其他值，开关打开，考虑相对论效应摄动
        public int m_rel;
        // 固体潮汐摄动控制开关，0：不考虑；其他值，开关打开，考虑固体潮汐摄动           
        public int m_tide;
        //初始化积分器时的位置速度(ECI)
        public NodePosVel m_orbit;
        //积分器使用的跳秒值
        public double m_LeapSec;

    }

    /// <summary>
    /// 轨道预报输出
    /// </summary>
    public struct OrbitPredict_Output
    {
        //轨道积分结果；
        public BackDiff satdf;
    }
    #endregion 卫星轨道动态库增加结构体

    [TypeConverter(typeof(ExpandableObjectConverter))]
    public class SatPhaseOff
    {

    }

}
